<?php

    require_once 'config.php';
    $table = "wms_seeker";
    echo "<br>Program Begins Here";
    $error = "";
    $filled = "";

    if(isset($_POST['bt_submit1']))
    {
    
    echo "<br>Button Pressed";
   
    $username = $_POST["username"];
    $email = $_POST["email"];
    $prefix = $_POST['prefix'];
    $firstname = $_POST['firstname'];
    $lastname = $_POST['lastname'];
    $suffix = $_POST['suffix'];
    $address_num = $_POST['address_num'];
    $address_st_name = $_POST['address_st_name'];
    $city = $_POST['city'];
    $state = $_POST['state'];
    $zip = $_POST['zip'];
    $gender = $_POST['gender'];
    $phone_home = $_POST['phone_home'];
    $password = $_POST['newpass'];
    $confirm_password = $_POST['confirmnewpass'];
    $date_registered = date("m.d.y");
    echo "<br> Form Data Captured on: $date_registered ";
   
    
    $sql = "INSERT INTO wms_seeker (username, email_address, prefix, fname, lname, ";
    $sql .= "suffix, address_num, address_st_name, city, state, zip, gender, ";
    $sql .= "phone_home, passwd, date_register) ";
    $sql .= "VALUES ('$username', '$email', '$prefix', '$firstname', '$lastname', "; 
	$sql .= "'$suffix', '$address_num', '$address_st_name', '$city', '$state', '$zip', ";
	$sql .= "'$gender', '$phone_home', '$password', '$date_registered')";
	
	echo "<br><br>$sql";


//    $sql = "INSERT INTO ".$table." SET ";
//    $sql .= "username=$username, passwd=$password, email_address=$email,";
///    $sql .= " prefix=$prefix, fname=$firstname, lname=$lastname, suffix=$suffix,";
//  $sql .= " address_num=$address_num, address_st_name = $address_st_name,";
//$sql .= " city=$city, state=$state, zip=$zip,";
//$sql .= " gender=$gender, phone_home=$phone_home"; 
    
	$result = mysql_query($sql);
	echo "<br><br>";
	
	if (!$result) die ("Database access failed: " . mysql_error());
	
	echo "<br>Job Seeker Registered";  
    }
   
    require_once '1.1_register.html';
?>